package com.itheima.service;

import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import com.itheima.utils.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class UserService {
    public String fiandAllUser() {
        SqlSession session = SqlSessionUtil.getSession();
        UserDao dao = session.getMapper(UserDao.class);
        List<User> list= dao.findAllUser();
        session.close();
        String json =list.toString();
        return json;
    }

}
